﻿using Newtonsoft.Json;

namespace Ecobee.Net
{
	public class ThermostatProgram : ApiObject
	{
		private ScheduleList _schedules = null;
		private ClimateList _climates = null;
		private string _currentClimateRef = string.Empty;

		public ThermostatProgram()
		{
			_climates = new ClimateList();
			_schedules = new ScheduleList();
		}

		[JsonProperty(PropertyName = "schedule")]
		public ScheduleList Schedules
		{
			get
			{
				return _schedules;
			}
			set
			{
				_schedules = value;
			}
		}

		[JsonProperty(PropertyName = "climates")]
		public ClimateList Climates
		{
			get
			{
				return _climates;
			}
			set
			{
				_climates = value;
			}
		}

		[JsonProperty(PropertyName = "currentClimateRef")]
		public string CurrentClimateRef
		{
			get
			{
				return _currentClimateRef;
			}
			set
			{
				_currentClimateRef = value;
			}
		}

		public override void LoadFrom(dynamic dataObject)
		{
			this.Schedules.Clear();
			this.Climates.Clear();
			base.LoadFrom((object)dataObject);
		}
	}
}
